package cn.class2.demo3

/**
  * Created by lzd on 2018/11/12.
  */
//第一个private代表构造器的访问权限
class Demo3 private[demo3](val id: Long, var age: Int, password: String, private var account: String) {
  //如果在构造器中定义一个变量没有用var或val修饰，相当于private[this]修订的变量

}
object Demo3{
  def main(args: Array[String]): Unit = {
    val d1 = new Demo3(1,1,"111","1111")
    println(d1.id)
    println(d1.age)
//    println(d1.password)
    println(d1.account)
  }
}

object Other{
  def main(args: Array[String]): Unit = {
    val d1 = new Demo3(1,1,"111","1111")
    println(d1.id)
    println(d1.age)
    //    println(d1.password)
//    println(d1.account)
  }
}
